package router

import (
	"galaxy-manage/internal/api/auth"
	"galaxy-manage/internal/api/user"
)

const basePath = "/api/v1"

func setApiRouter(r *resource) {

	//用户api
	userHandler := user.New(r.logger, r.db, r.cache)
	users := r.mux.Group(basePath + "/user")
	{
		users.GET("/page", userHandler.GetUserPage())
	}
	//授权api
	authHandler := auth.New(r.logger, r.db, r.cache)
	auths := r.mux.Group(basePath + "/auth")
	{
		auths.GET("/captcha", authHandler.GetCaptcha())
		auths.POST("/login", authHandler.Login())
	}
}
